<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <div v-if="contentInfo">
        <h2 class="jh-entity-heading" data-cy="contentInfoDetailsHeading">
          <span v-text="$t('jhipsterserverApp.contentInfo.detail.title')">ContentInfo</span> {{ contentInfo.id }}
        </h2>
        <dl class="row jh-entity-details">
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentAuthor')">Content Author</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentAuthor }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentText')">Content Text</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentText }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentImg')">Content Img</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentImg }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentTime')">Content Time</span>
          </dt>
          <dd>
            <span v-if="contentInfo.contentTime">{{ $d(Date.parse(contentInfo.contentTime), 'long') }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentPraiseCount')">Content Praise Count</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentPraiseCount }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentFavorateCount')">Content Favorate Count</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentFavorateCount }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentImgLabel')">Content Img Label</span>
          </dt>
          <dd>
            <span>{{ contentInfo.contentImgLabel }}</span>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.account')">Account</span>
          </dt>
          <dd>
            <div v-if="contentInfo.account">
              <router-link :to="{ name: 'UserAccountView', params: { userAccountId: contentInfo.account.id } }">{{
                contentInfo.account.id
              }}</router-link>
            </div>
          </dd>
          <dt>
            <span v-text="$t('jhipsterserverApp.contentInfo.contentType')">Content Type</span>
          </dt>
          <dd>
            <div v-if="contentInfo.contentType">
              <router-link :to="{ name: 'ContentTypeView', params: { contentTypeId: contentInfo.contentType.id } }">{{
                contentInfo.contentType.id
              }}</router-link>
            </div>
          </dd>
        </dl>
        <button type="submit" v-on:click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span v-text="$t('entity.action.back')"> Back</span>
        </button>
        <router-link
          v-if="contentInfo.id"
          :to="{ name: 'ContentInfoEdit', params: { contentInfoId: contentInfo.id } }"
          custom
          v-slot="{ navigate }"
        >
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span v-text="$t('entity.action.edit')"> Edit</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./content-info-details.component.ts"></script>
